<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../css/mui.min.css">
		<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
		<link rel="stylesheet" href="../css/iconfont.css">
		<style>
			.mui-content-padded{margin:5px 0 0 0;}
			.mui-row-list span{float: left; line-height:33px; width:20%;}
			.mui-row-list select{float: left; line-height:14px; font-size:14px; margin-top:2px; margin-left: 5px;}
			.mui-btn-block{margin-bottom:0; padding:6px;}
			.mui-col-sm-12{ border-top: 1px solid #D1D1D1; width:100%; padding-top:5px; font-size:14px;}
			.mui-switch{
				border-color: #007AFF;
				background-color: #007AFF;
				border-width: 1px;
			}
			.mui-switch:before {content: '无'; color: #fff; right: 10px;}
			.mui-switch.mui-active:before {content: '有'; color: #fff; left: 10px;}
			.mui-switch.mui-active {
				border-color: #fd933b;
				background-color: #fd933b;
			}
			.mui-table-view-cell.mui-active{ display:block;}
			input{border-width:0; text-align: right; font-size:14px; line-height: 26px;}
			input[type="number"]{height:26px; padding: 0;border-width:0;margin-bottom:0;background:none;}
			.bottom_soild{border-bottom: 1px solid #DDDDDD; margin-right: 5px;}
			.submit{
				margin:0 auto 10px auto; 
				width:200px; 
				height:35px; 
				line-height: 35px; 
				background-color:#007AFF; 
				text-align: center; 
				color: #FFFFFF; 
				border-radius: 10px;
				margin-top: 10px;
			}
		</style>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">辅助检查</h1>
		</header>
		<div class="mui-conten" style="margin-top:50px;">
			<div style="margin-left:0.9rem; line-height:35px;">社会功能情况</div>
			<ul class="mui-table-view">
				<div class="mui-row">
					<div class="mui-col-sm-12 mui-col-xs-12">
						<li class="mui-table-view-cell">
							<a id='demo1' data-options='{"type":"date"}' class="btn mui-navigate-right">
								<div style="float: left; font-size: 16px;">个人生活料理</div>
								<input id='result0' class="ui-alert" placeholder="请选择" style="width:50%; float:right; margin-right:15px;"/>
							</a>
						</li>
						<li class="mui-table-view-cell">
							<a id='demo1' data-options='{"type":"date"}' class="btn mui-navigate-right">
								<div style="float: left; font-size: 16px;">家务劳动</div>
								<input id='result1' class="ui-alert" placeholder="请选择" style="width:50%; float:right; margin-right:15px;"/>
							</a>
						</li>
						<li class="mui-table-view-cell">
							<a id='demo1' data-options='{"type":"date"}' class="btn mui-navigate-right">
								<div style="float: left; font-size: 16px;">生产劳动及工作</div>
								<input id='result2' class="ui-alert" placeholder="请选择" style="width:50%; float:right; margin-right:15px;"/>
							</a>
						</li>
						<li class="mui-table-view-cell">
							<a id='demo1' data-options='{"type":"date"}' class="btn mui-navigate-right">
								<div style="float: left; font-size: 16px;">学习能力</div>
								<input id='result3' class="ui-alert" placeholder="请选择" style="width:50%; float:right; margin-right:15px;"/>
							</a>
						</li>
						<li class="mui-table-view-cell">
							<a id='demo1' data-options='{"type":"date"}' class="btn mui-navigate-right">
								<div style="float: left; font-size: 16px;">社会人际交往</div>
								<input id='result4' class="ui-alert" placeholder="请选择" style="width:50%; float:right; margin-right:15px;"/>
							</a>
						</li>
					</div>
				</div>
			</ul>
			<ul class="mui-table-view" style="margin-top: 5px;">
				<div class="mui-row">
					<div class="mui-col-sm-12 mui-col-xs-12">
						<li class="mui-table-view-cell">
							<div style="float: left; font-size: 16px;">危险行为</div>
							<div class="mui-switch" id="mySwitch">
							  <div class="mui-switch-handle"></div>
							</div>
						</li>
						<div class="mui-table-view-cell" style="display: none;" id="tigshow">
							<li class="mui-table-view-cell">
								<div style="white-space: normal; float: left; font-size: 14px; width: 100px; line-height: 26px;">轻度滋事</div>
								<div style="float: right; font-size: 14px; margin: 0 5px; padding: 0; line-height: 26px;">次</div>
								<input id='dangerous1' type="number" class="ui-alert bottom_soild" placeholder="请输入" style="width:33%; float: right;"/>
							</li>
							<li class="mui-table-view-cell">
								<div style="white-space: normal; float: left; font-size: 14px; width: 100px; line-height: 26px;">肇事</div>
								<div style="float: right; font-size: 14px; margin: 0 5px; padding: 0; line-height: 26px;">次</div>
								<input id='dangerous2' type="number" class="ui-alert bottom_soild" placeholder="请输入" style="width:33%; float: right;"/>
							</li>
							<li class="mui-table-view-cell">
								<div style="white-space: normal; float: left; font-size: 14px; width: 100px; line-height: 26px;">肇祸</div>
								<div style="float: right; font-size: 14px; margin: 0 5px; padding: 0; line-height: 26px;">次</div>
								<input id='dangerous3' type="number" class="ui-alert bottom_soild" placeholder="请输入" style="width:33%; float: right;"/>
							</li>
							<li class="mui-table-view-cell">
								<div style="white-space: normal; float: left; font-size: 14px; width: 100px; line-height: 26px;">其他危害行为</div>
								<div style="float: right; font-size: 14px; margin: 0 5px; padding: 0; line-height: 26px;">次</div>
								<input id='dangerous4' type="number" class="ui-alert bottom_soild" placeholder="请输入" style="width:33%; float: right;"/>
							</li>
							<li class="mui-table-view-cell">
								<div style="white-space: normal; float: left; font-size: 14px; width: 100px; line-height: 26px;">自伤</div>
								<div style="float: right; font-size: 14px; margin: 0 5px; padding: 0; line-height: 26px;">次</div>
								<input id='dangerous5' type="number" class="ui-alert bottom_soild" placeholder="请输入" style="width:33%; float: right;"/>
							</li>
							<li class="mui-table-view-cell">
								<div style="white-space: normal; float: left; font-size: 14px; width: 100px; line-height: 26px;">自杀未遂</div>
								<div style="float: right; font-size: 14px; margin: 0 5px; padding: 0; line-height: 26px;">次</div>
								<input id='dangerous6' type="number" class="ui-alert bottom_soild" placeholder="请输入" style="width:33%; float: right;"/>
							</li>
						</div>
					</div>
				</div>
			</ul>
			<div style="margin-left:0.9rem; line-height:35px;">两次随访期间</div>
			<ul class="mui-table-view">
				<div class="mui-row">
					<div class="mui-col-sm-12 mui-col-xs-12">
						<li class="mui-table-view-cell">
							<a id='demo1' data-options='{"type":"date"}' class="btn mui-navigate-right">
								<div style="float: left; font-size: 16px;">关锁情况</div>
								<input id='result5' class="ui-alert" placeholder="请选择" style="width:50%; float:right; margin-right:15px;"/>
							</a>
						</li>
						<li class="mui-table-view-cell">
							<a id='demo1' data-options='{"type":"date"}' class="btn mui-navigate-right">
								<div style="float: left; font-size: 16px;">住院情况</div>
								<input id='result6' class="ui-alert" placeholder="请选择" style="width:50%; float:right; margin-right:15px;"/>
							</a>
						</li>
						<li class="mui-table-view-cell">
							<a id='demo1' data-options='{"type":"date"}' class="btn mui-navigate-right">
								<div style="float: left; font-size: 16px;">末次出院时间</div>
								<input id='result7' class="ui-alert" placeholder="请选择" style="width:50%; float:right; margin-right:15px;"/>
							</a>
						</li>
					</div>
				</div>
			</ul>
			<ul class="mui-table-view" style="margin-top: 5px;">
				<div class="mui-row">
					<div class="mui-col-sm-12 mui-col-xs-12">
						<li class="mui-table-view-cell">
							<div style="float: left; font-size: 16px;">实验室检查</div>
							<div class="mui-switch" id="mySwitch1">
							  <div class="mui-switch-handle"></div>
							</div>
						</li>
						<li class="mui-table-view-cell" style="display: none;" id="check">
							<input class="ui-alert bottom_soild" id='checktext' placeholder="请输入" style="width:100%; float: left; text-align: left;"/>
						</li>
					</div>
				</div>
			</ul>
			<div onclick="submit()" class="submit" >保存</div>
		</div>
		<script src="../js/mui.js"></script>
		<script src="../js/mui.picker.min.js"></script>
		<script src="../js/jquery.min-1.11.1.js"></script>
		<script src="../js/request.js"></script>
		<script type="text/javascript">
			//获取变量
			var self = localStorage.getItem("name")
			console.log(self)
			var dataold = JSON.parse(self)
			var obj = dataold.obj
			var selfdata ="";
			var listdata ="";
			mui.plusReady(function(){
				var self = plus.webview.currentWebview()
					listdata = self.data;
					visitId = self.visitdata;
					selfdata = JSON.parse(listdata)
					console.log(selfdata)
					console.log(selfdata.ehrId)
				var date1 = new Date();
				var year1=date1.getFullYear(); 
				var month1=date1.getMonth()+1;
				var day1=date1.getDate();
				var h1=date1.getHours();
				var m1=date1.getMinutes();
				var s1=date1.getSeconds();
					month1 =(month1<10 ? "0"+month1:month1); 
					day1 =(day1<10 ? "0"+day1:day1); 
					h1 =(h1<10 ? "0"+h1:h1); 
					m1 =(m1<10 ? "0"+m1:m1); 
					s1 =(s1<10 ? "0"+s1:s1);
					createDate = (year1.toString()+'-'+month1.toString()+'-'+day1.toString()+' '+h1.toString()+':'+m1.toString()+':'+s1.toString());
					updateDate = (year1.toString()+'-'+month1.toString()+'-'+day1.toString()+' '+h1.toString()+':'+m1.toString()+':'+s1.toString());
					ehrId = selfdata.ehrId;
				if(self.second != ""){
					first = JSON.parse(self.first);
					second = JSON.parse(self.second);
					id = first.id;
					createUser = first.createUser;
					createDate = first.createDate;
					console.log(self.second);
					for(var i=0; i<second.length; i++){
						if(second[i].questionId == "30"){
							var rowsresult0=resultall.r1
							for (var j=0; j<rowsresult0.length; j++) {
								if(second[i].answerId == rowsresult0[j].value){
								document.getElementById("result0").value = rowsresult0[j].text;
								}
							}
						}
						if(second[i].questionId == "31"){
							var rowsresult1=resultall.r1
							for (var j=0; j<rowsresult1.length; j++) {
								if(second[i].answerId == rowsresult1[j].value){
								document.getElementById("result1").value = rowsresult1[j].text;
								}
							}
						}
						if(second[i].questionId == "32"){
							var rowsresult2=resultall.r1
							for (var j=0; j<rowsresult2.length; j++) {
								if(second[i].answerId == rowsresult2[j].value){
								document.getElementById("result2").value = rowsresult2[j].text;
								}
							}
						}
						if(second[i].questionId == "33"){
							var rowsresult3=resultall.r1
							for (var j=0; j<rowsresult3.length; j++) {
								if(second[i].answerId == rowsresult3[j].value){
								document.getElementById("result3").value = rowsresult3[j].text;
								}
							}
						}
						if(second[i].questionId == "34"){
							var rowsresult4=resultall.r1
							for (var j=0; j<rowsresult4.length; j++) {
								if(second[i].answerId == rowsresult4[j].value){
								document.getElementById("result4").value = rowsresult4[j].text;
								}
							}
						}
						if(second[i].questionId == "91"){
							if(second[i].answerId == "1"){
								document.getElementById("tigshow").style.display = "block";
								document.getElementById("mySwitch").classList.add('mui-active');
							}else{
								document.getElementById("tigshow").style.display = "none";
								document.getElementById("mySwitch").classList.remove('mui-active');
							}
						}
						if(second[i].questionId == "35"){
							document.getElementById("dangerous1").value = second[i].answer;
						}
						if(second[i].questionId == "36"){
							document.getElementById("dangerous2").value = second[i].answer;
						}
						if(second[i].questionId == "37"){
							document.getElementById("dangerous3").value = second[i].answer;
						}
						if(second[i].questionId == "753"){
							document.getElementById("dangerous4").value = second[i].answer;
						}
						if(second[i].questionId == "38"){
							document.getElementById("dangerous5").value = second[i].answer;
						}
						if(second[i].questionId == "39"){
							document.getElementById("dangerous6").value = second[i].answer;
						}
						if(second[i].questionId == "40"){
							var rowsresult5=resultall.r2
							for (var j=0; j<rowsresult5.length; j++) {
								if(second[i].answerId == rowsresult5[j].value){
								document.getElementById("result5").value = rowsresult5[j].text;
								}
							}
						}
						if(second[i].questionId == "87"){
							var rowsresult6=resultall.r3
							for (var j=0; j<rowsresult6.length; j++) {
								if(second[i].answerId == rowsresult6[j].value){
								document.getElementById("result6").value = rowsresult6[j].text;
								}
							}
						}
						if(second[i].questionId == "88"){
							//随访日期
							var datev = new Date(second[i].answer);
							var yearv=datev.getFullYear(); 
							var monthv=datev.getMonth()+1;
							var dayv=datev.getDate();
								monthv =(monthv<10 ? "0"+monthv:monthv); 
								dayv =(dayv<10 ? "0"+dayv:dayv); 
							result7 = (yearv.toString()+'-'+monthv.toString()+'-'+dayv.toString());
							document.getElementById("result7").value = result7;
						}
						if(second[i].questionId == "89"){
							if(second[i].answerId == "1"){
								document.getElementById("check").style.display = "block";
								document.getElementById("mySwitch1").classList.add('mui-active');
							}else{
								document.getElementById("check").style.display = "none";
								document.getElementById("mySwitch1").classList.remove('mui-active');
							}
						}
						if(second[i].questionId == "50"){
							document.getElementById("checktext").value = second[i].answer;
						}
					}
				}
			})
			//赋值
			var resultall = {"r1":[{value:'0',text:' '},{value:'44',text:'良好'},{value:'45',text:'一般'},{value:'46',text:'较差'},{value:'681',text:'此项不适用'}],
							"r2":[{value:'0',text:' '},{value:'47',text:'无关锁'},{value:'48',text:'关锁'},{value:'49',text:'关锁已解除'}],
							"r3":[{value:'0',text:' '},{value:'82',text:'未住院'},{value:'83',text:'目前正在住院'},{value:'84',text:'曾住院，现未出院'}]}
			var id = 0;
			var visitId= 0;
			var ehrId = "";
			var manageId = 0;
			var createUser = obj.id;
			var createDate = "";
			var updateUser = obj.id;
			var updateDate = "";
			var result0 = "";
			var result1 = "";
			var result2 = "";
			var result3 = "";
			var result4 = "";
			var result5 = "";
			var result6 = "";
			var result7 = "";
			var mySwitch = "2";
			var mySwitch1 = "2";
			mui.init()
			(function($) {
				$.init();
				var result = $('#result')[0];
				var btns = $('.btn');
				btns.each(function(i, btn) {
					btn.addEventListener('tap', function() {
						var _self = this;
						if(_self.picker) {
							_self.picker.show(function (rs) {
								result.innerText = rs.text;
								_self.picker.dispose();
								_self.picker = null;
							});
						} else {
							if(i == 0){//个人生活料理
								var picker = new mui.PopPicker();
								 picker.setData([{value:'44',text:'良好'},{value:'45',text:'一般'},{value:'46',text:'较差'}]);
								 picker.show(function (selectItems) {
									 $('#result'+i)[0].value = selectItems[0].text;
									 result0 = selectItems[0].value;
								  })
							}else if(i == 1){//家务劳动
								var picker = new mui.PopPicker();
								 picker.setData([{value:'44',text:'良好'},{value:'45',text:'一般'},{value:'46',text:'较差'}]);
								 picker.show(function (selectItems) {
									 $('#result'+i)[0].value = selectItems[0].text;
									 result1 = selectItems[0].value;
								  })
							}else if(i == 2){//生产劳动及工作
								var picker = new mui.PopPicker();
								 picker.setData([{value:'44',text:'良好'},{value:'45',text:'一般'},{value:'46',text:'较差'},{value:'681',text:'此项不适用'}]);
								 picker.show(function (selectItems) {
									 $('#result'+i)[0].value = selectItems[0].text;
									 result2 = selectItems[0].value;
								  })
							}else if(i == 3){//学习能力
								var picker = new mui.PopPicker();
								 picker.setData([{value:'44',text:'良好'},{value:'45',text:'一般'},{value:'46',text:'较差'}]);
								 picker.show(function (selectItems) {
									 $('#result'+i)[0].value = selectItems[0].text;
									 result3 = selectItems[0].value;
								  })
							}else if(i == 4){//社会人际交往
								var picker = new mui.PopPicker();
								 picker.setData([{value:'44',text:'良好'},{value:'45',text:'一般'},{value:'46',text:'较差'}]);
								 picker.show(function (selectItems) {
									 $('#result'+i)[0].value = selectItems[0].text;
									 result4 = selectItems[0].value;
								  })
							}else if(i == 5){//关锁情况
								var picker = new mui.PopPicker();
								 picker.setData([{value:'47',text:'无关锁'},{value:'48',text:'关锁'},{value:'49',text:'关锁已解除'}]);
								 picker.show(function (selectItems) {
									 $('#result'+i)[0].value = selectItems[0].text;
									 result5 = selectItems[0].value;
								  })
							}else if(i == 6){//住院情况
								var picker = new mui.PopPicker();
								 picker.setData([{value:'82',text:'未住院'},{value:'83',text:'目前正在住院'},{value:'84',text:'曾住院，现未出院'}]);
								 picker.show(function (selectItems) {
									 $('#result'+i)[0].value = selectItems[0].text;
									 result6 = selectItems[0].value;
								  })
							}else{
								var optionsJson = this.getAttribute('data-options') || '{}';
								var options = JSON.parse(optionsJson);
								var id = this.getAttribute('id');
								/*
								 * 首次显示时实例化组件
								 * 示例为了简洁，将 options 放在了按钮的 dom 上
								 * 也可以直接通过代码声明 optinos 用于实例化 DtPicker
								 */
								_self.picker = new $.DtPicker(options);
								_self.picker.show(function(rs) {
									/*
									 * rs.value 拼合后的 value
									 * rs.text 拼合后的 text
									 * rs.y 年，可以通过 rs.y.vaue 和 rs.y.text 获取值和文本
									 * rs.m 月，用法同年
									 * rs.d 日，用法同年
									 * rs.h 时，用法同年
									 * rs.i 分（minutes 的第二个字母），用法同年
									 */
									$('#result7')[0].value = rs.text;
									/* 
									 * 返回 false 可以阻止选择框的关闭
									 * return false;
									 */
									/*
									 * 释放组件资源，释放后将将不能再操作组件
									 * 通常情况下，不需要示放组件，new DtPicker(options) 后，可以一直使用。
									 * 当前示例，因为内容较多，如不进行资原释放，在某些设备上会较慢。
									 * 所以每次用完便立即调用 dispose 进行释放，下次用时再创建新实例。
									 */
									_self.picker.dispose();
									_self.picker = null;
								});
							}
						}
						
					}, false);
				});
			})(mui);
			//切换
			document.getElementById("mySwitch").addEventListener("toggle",function(event){
				if(event.detail.isActive){
					document.getElementById("tigshow").style.display = "block";
				}else{
					document.getElementById("tigshow").style.display = "none";
				}
			})
			document.getElementById("mySwitch1").addEventListener("toggle",function(event){
				if(event.detail.isActive){
					document.getElementById("check").style.display = "block";
				}else{
					document.getElementById("check").style.display = "none";
					document.getElementById("checktext").value = ""
				}
			})
			//提交
			function submit(){
				var result0_1 = $('#result0')[0].value;
				for(var re=0; re<resultall.r1.length; re++){
					if(result0_1 == resultall.r1[re].text){
						result0 = resultall.r1[re].value;
					}
				}
				var result1_1 = $('#result1')[0].value;
				for(var re=0; re<resultall.r1.length; re++){
					if(result1_1 == resultall.r1[re].text){
						result1 = resultall.r1[re].value;
					}
				}
				var result2_1 = $('#result2')[0].value;
				for(var re=0; re<resultall.r1.length; re++){
					if(result2_1 == resultall.r1[re].text){
						result2 = resultall.r1[re].value;
					}
				}
				var result3_1 = $('#result3')[0].value;
				for(var re=0; re<resultall.r1.length; re++){
					if(result3_1 == resultall.r1[re].text){
						result3 = resultall.r1[re].value;
					}
				}
				var result4_1 = $('#result4')[0].value;
				for(var re=0; re<resultall.r1.length; re++){
					if(result4_1 == resultall.r1[re].text){
						result4 = resultall.r1[re].value;
					}
				}
				var result5_1 = $('#result5')[0].value;
				for(var re=0; re<resultall.r2.length; re++){
					if(result5_1 == resultall.r2[re].text){
						result5 = resultall.r2[re].value;
					}
				}
				var result6_1 = $('#result6')[0].value;
				for(var re=0; re<resultall.r3.length; re++){
					if(result6_1 == resultall.r3[re].text){
						result6 = resultall.r3[re].value;
					}
				}
				if($('#result7')[0].value != ""){
					result7 = $('#result7')[0].value+" 00:00:00";//末次出院时间
				}
				if($("#mySwitch").hasClass("mui-active")){
					mySwitch = "1";
				}else{
					mySwitch = "2";
				}
				if($("#mySwitch1").hasClass("mui-active")){
					mySwitch1 = "1";
				}else{
					mySwitch1 = "2";
					document.getElementById("checktext").value = ""
				}
				var dataobj=[
					//个人生活料理
					{'ehrId':ehrId,
					"visitId":visitId,
					"questionId":"30",
					"answerId":result0,
					"answer":null,
					"createDate":createDate,
					"updateDate":updateDate,
					"createUser":createUser,
					"updateUser":updateUser},
					//家务劳动
					{'ehrId':ehrId,
					"visitId":visitId,
					"questionId":"31",
					"answerId":result1,
					"answer":null,
					"createDate":createDate,
					"updateDate":updateDate,
					"createUser":createUser,
					"updateUser":updateUser},
					//生产劳动及工作
					{'ehrId':ehrId,
					"visitId":visitId,
					"questionId":"32",
					"answerId":result2,
					"answer":null,
					"createDate":createDate,
					"updateDate":updateDate,
					"createUser":createUser,
					"updateUser":updateUser},
					//学习能力
					{'ehrId':ehrId,
					"visitId":visitId,
					"questionId":"33",
					"answerId":result3,
					"answer":null,
					"createDate":createDate,
					"updateDate":updateDate,
					"createUser":createUser,
					"updateUser":updateUser},
					//社会人际交往
					{'ehrId':ehrId,
					"visitId":visitId,
					"questionId":"34",
					"answerId":result4,
					"answer":null,
					"createDate":createDate,
					"updateDate":updateDate,
					"createUser":createUser,
					"updateUser":updateUser},
					//关锁情况
					{'ehrId':ehrId,
					"visitId":visitId,
					"questionId":"40",
					"answerId":result5,
					"answer":null,
					"createDate":createDate,
					"updateDate":updateDate,
					"createUser":createUser,
					"updateUser":updateUser},
					//住院情况
					{'ehrId':ehrId,
					"visitId":visitId,
					"questionId":"87",
					"answerId":result6,
					"answer":null,
					"createDate":createDate,
					"updateDate":updateDate,
					"createUser":createUser,
					"updateUser":updateUser},
					//末次出院时间
					{'ehrId':ehrId,
					"visitId":visitId,
					"questionId":"88",
					"answerId":"0",
					"answer":result7,
					"createDate":createDate,
					"updateDate":updateDate,
					"createUser":createUser,
					"updateUser":updateUser},
					//危险行为
					{'ehrId':ehrId,
					"visitId":visitId,
					"questionId":"91",
					"answerId":mySwitch,
					"answer":null,
					"createDate":createDate,
					"updateDate":updateDate,
					"createUser":createUser,
					"updateUser":updateUser},
					//实验室检查
					{'ehrId':ehrId,
					"visitId":visitId,
					"questionId":"89",
					"answerId":mySwitch1,
					"answer":null,
					"createDate":createDate,
					"updateDate":updateDate,
					"createUser":createUser,
					"updateUser":updateUser},
					//实验室检查内容
					{'ehrId':ehrId,
					"visitId":visitId,
					"questionId":"50",
					"answerId":"0",
					"answer":mui("#checktext")[0].value,
					"createDate":createDate,
					"updateDate":updateDate,
					"createUser":createUser,
					"updateUser":updateUser},
					//轻度滋事
					{'ehrId':ehrId,
					"visitId":visitId,
					"questionId":"35",
					"answerId":"0",
					"answer":mui("#dangerous1")[0].value,
					"createDate":createDate,
					"updateDate":updateDate,
					"createUser":createUser,
					"updateUser":updateUser},
					//肇事
					{'ehrId':ehrId,
					"visitId":visitId,
					"questionId":"36",
					"answerId":"0",
					"answer":mui("#dangerous2")[0].value,
					"createDate":createDate,
					"updateDate":updateDate,
					"createUser":createUser,
					"updateUser":updateUser},
					//肇祸
					{'ehrId':ehrId,
					"visitId":visitId,
					"questionId":"37",
					"answerId":"0",
					"answer":mui("#dangerous3")[0].value,
					"createDate":createDate,
					"updateDate":updateDate,
					"createUser":createUser,
					"updateUser":updateUser},
					//其他危害行为
					{'ehrId':ehrId,
					"visitId":visitId,
					"questionId":"753",
					"answerId":"0",
					"answer":mui("#dangerous4")[0].value,
					"createDate":createDate,
					"updateDate":updateDate,
					"createUser":createUser,
					"updateUser":updateUser},
					//自伤
					{'ehrId':ehrId,
					"visitId":visitId,
					"questionId":"38",
					"answerId":"0",
					"answer":mui("#dangerous5")[0].value,
					"createDate":createDate,
					"updateDate":updateDate,
					"createUser":createUser,
					"updateUser":updateUser},
					//自杀未遂
					{'ehrId':ehrId,
					"visitId":visitId,
					"questionId":"39",
					"answerId":"0",
					"answer":mui("#dangerous6")[0].value,
					"createDate":createDate,
					"updateDate":updateDate,
					"createUser":createUser,
					"updateUser":updateUser}
				]
				$.ajax({
					type: 'post',
					url:getRequestUrl.url+"/mobile/ehr/psychosisVisitAnswer/addOrUpdate",
					data:JSON.stringify(dataobj),
					dataType:"json",
					contentType : 'application/json;charset=utf-8',
					success : function(data) {
						if(data.status==1){
							alert("提交成功")
							mui.openWindow({
								url: 'follow_up_add.html', 
								id:'follow_up_add',
								extras:{
									
								}
							});
						}else{
							alert(data.message);
						}
					},
					error:function(xhr,type,errorThrown){
						
					}
				})
			}
		</script>
	</body>
</html>